<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="pp">
        hello
    </div>
    <script>
        const data = {
            msg: 'hello',
            count: 10
        }

        // 模拟vue实例
        let vm = new Proxy(data, {
            get(target, key) {
                return target[key]
            },
            set(target, key, newVal) {
                if(newVal === target[key]) return
                target[key] = newVal
                document.querySelector('#app').textContent = target[key]
            }
        })
        vm.msg = 'hello, word'
    </script>
</body>
</html>